package com.yc.booktable.mapper;

import com.yc.booktable.entity.AdminUser;
import com.yc.booktable.entity.Food;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zbh
 * @since 2022-06-06
 */
@Repository
public interface FoodMapper extends BaseMapper<Food> {

    @Select("SELECT food.fname,food.price,food.fdesc " +
            " FROM food,foodtype " +
            " WHERE foodtype.tid = #{tid} " +
            "     AND foodtype.ftype=food.ftype")
    List<Food> findList(@Param("tid") Long tid);

    @Select("select * from food where fid != #{fid}")
    List<Food> selectfby(@PathVariable("fid") Integer fid);
}
